package com.project.action;

import java.util.List;

import net.sf.json.JSONArray;

import com.project.entity.ProjectManagement;
import com.project.service.DataManage;
import com.project.util.POITest;

public class TestAction {
	private DataManage datamanageservice;
	private String jsonString;// 使用json传递数据
	
	public String getJsonString() {
		return jsonString;
	}

	public void setJsonString(String jsonString) {
		this.jsonString = jsonString;
	}



	public DataManage getDatamanageservice() {
		return datamanageservice;
	}

	public void setDatamanageservice(DataManage datamanageservice) {
		this.datamanageservice = datamanageservice;
	}

	public String TestPOI(){
		POITest abc = new POITest();
		abc.setPath("D:\\test.xls");
		abc.setFileName("");
		List<ProjectManagement> tmplist=abc.fileImport();
		for(ProjectManagement tmp : tmplist){
			this.datamanageservice.insertProject(tmp);
			System.out.println("Fuck!");
		}
		JSONArray jsonObject = JSONArray.fromObject(tmplist);
		this.setJsonString("{success:true,totalCount : " +tmplist.size()
				+ ", list:" + jsonObject.toString() + "}");
		return "success";
	}

}
